package com.probox.common.entity.domain.platfom;

import java.util.Date;
import java.io.Serializable;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.probox.common.core.enums.DataStatus;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import com.baomidou.mybatisplus.annotation.*;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.probox.common.core.annotation.Excel;

/**
 * 信息分类对象 platform_cms_class
 *
 * @date 2021-06-11
 */
@Data
@Accessors(chain = true)
@TableName("platform_cms_class")
public class PlatformCmsClass implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * 信息分类UID
     */
    //默认主键自增
    @TableId(value = "CMS_CLASS_UID", type = IdType.AUTO)
    private Long cmsClassUid;
    /**
     * 父级UID
     */
    @Excel(name = "父级UID")
    private Long cmsClassPuid;
    /**
     * 分类代码
     */
    @Excel(name = "分类代码")
    private String cmsClassCode;
    /**
     * 分类名称
     */
    @Excel(name = "分类名称")
    private String cmsClassName;
    /**
     * 分类父级名称
     */
    @Excel(name = "分类父级名称")
    private String cmsClassPname;
    /**
     * 是否叶节点(0否/1是)
     */
    @Excel(name = "是否叶节点(0否/1是)")
    private String isCmsLeaf;
    /**
     * 状态(0无效/1有效)
     */
    @Excel(name = "状态(0无效/1有效)")
    private String dataStatus;
    /**
     * 排序
     */
    @Excel(name = "排序")
    private Long dataPriority;
    /**
     * $column.columnComment
     */
    @Excel(name = "排序")
    private Long createUid;
    /**
     * $column.columnComment
     */
    @Excel(name = "排序")
    private String createName;
    /**
     * $column.columnComment
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "排序", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;
    /**
     * $column.columnComment
     */
    @Excel(name = "排序")
    private Long updateUid;
    /**
     * $column.columnComment
     */
    @Excel(name = "排序")
    private String updateName;
    /**
     * $column.columnComment
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "排序", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;
    /**
     * 平台ID
     */
    @Excel(name = "平台ID")
    private Long platformUid;

    public PlatformCmsClass() {

    }

    //初始化资讯,公告,平台信息
    public PlatformCmsClass(Long type,Long uid) {
        this.cmsClassPuid = 0L;
        if (type == 0L) {
            this.cmsClassName = "公告";
        }
        if (type == 1L) {
            this.cmsClassName = "资讯";
        }
        if (type == 2L) {
            this.cmsClassName = "平台信息";
        }
        this.platformUid = uid;
        this.isCmsLeaf = "0";
        this.dataStatus = DataStatus.valid.getKey();
        this.dataPriority = type;
    }
}
